<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'list.jsp' starting page</title>
    
	<link  href="/css/content.css" rel="stylesheet" type="text/css">
	<style type="text/css">
		#down table {
			position: relative;
			left: 50%;
			margin-left: -500px;
			top: 50px;
			border-top: 1px #999 solid;
			border-right: 1px #999 solid;
		}
		#down tr {
			height: 60px;
		}
		
		#down tr td {
			text-align: center;
			border-left: 1px #999 solid;
			border-bottom: 1px #999 solid;
		}
		
		#up a:VISITED,#up a:LINK {
			color: #4C8FBD;
			text-decoration: none;
		}
		#up a:HOVER {
			color: #4C8FBD;
			text-decoration: none;
		}
		.head {
			background: #438EB9;
			color: #fff;
		}
		tbody tr:nth-child(odd) {
			background: #e5e5e5;
		}
		
		tbody tr:nth-child(even) {
			background: #d5d5d5;
		}
	</style>
	<script type="text/javascript" src="/js/jquery-1.8.3.js"></script>
	<script type="text/javascript">
		
	</script>
  </head>
  
  <body>
  	<div id="up">
	   <ul>
	    	<li><span><a href="/pages/main.jsp" target="_top">平台首页 </a>&gt; 用户管理 &gt; 用户列表</span></li>
	   </ul>
	</div>
	<div id="down">
	    <table width="1000px" cellpadding="0" cellspacing="0">
	    	<thead>
		    	<tr class="head">
		    		<td>序号</td>
					<td>主键</td>
					<td>用户名</td>
					<td>密码</td>
					<td>用户创建时间</td>
					<td>账户余额</td>
					<td>用户邮箱</td>
					<td>关联字段</td>
					<td>角色主键</td>
					<td>用户角色</td>
		    		<td>操作</td>
		    	</tr>
	    	</thead>
	    	<tbody>
				<c:forEach items="${list}" var="user" varStatus="status">
					<tr>
						<td>${status.count}</td>
						<td>${user.uid}</td>
						<td>${user.uname}</td>
						<td>${user.upassword}</td>
						<td>
							<fmt:formatDate value="${user.utime}" pattern="yyyy-MM-dd HH:mm:ss"/>
						</td>
						<td>${user.ucount}</td>
						<td>${user.uemil}</td>
						<td>${user.pid}</td>
						<td>${user.power.pid}</td>
						<td>${user.power.pname}</td>
			    		<td>
							<a href="/AdminUser/toEditUser?uid=${user.uid}">修改</a>&nbsp;|
							<c:if test="${user2.pid==1}">
								<a href="/AdminUser/deletById?uid=${user.uid}" class="del" onclick="return confirm('是否确定删除？')">删除</a>&nbsp;
							</c:if>
			    		</td>
			    	</tr>
				</c:forEach>
					<tr>
						<td colspan="11">
							<a href="/AdminUser/getAllUser?currentPage=1">首页</a>
							<a href="/AdminUser/getAllUser?currentPage=${pages.getPrePage()}">上一页</a>
							<c:forEach items="${pages.getPageList()}" var="num">
								<a href="/AdminUser/getAllUser?currentPage=${num}">[${num}]</a>
							</c:forEach>
							<a href="/AdminUser/getAllUser?currentPage=${pages.getNextPage()}">下一页</a>
							<a href="/AdminUser/getAllUser?currentPage=${pages.getTotalPage()}">尾页</a>
						</td>
					</tr>

			</tbody>
	    </table>
    </div>
  </body>
</html>
